using System;
using System.Collections.Generic;

namespace WDFactoryLib.TestKit
{
	public class BasicFactory: IFactory
	{
        private static BasicFactory defaultFactory = new BasicFactory();

        public static BasicFactory Default
        {
            get { return defaultFactory; }
        }

		#region IFactory Members

		public IDictionary<TKey, TValue> GetNewDictionary<TKey, TValue>()
		{
			return new Dictionary<TKey, TValue>();
		}

        public IDictionary<TKey, TValue> GetNewDictionary<TKey, TValue>(IEqualityComparer<TKey> comparer)
		{
			return new Dictionary<TKey, TValue>(comparer);
		}

        public IDictionary<TKey, TValue> GetNewDictionary<TKey, TValue>(IDictionary<TKey, TValue> dict)
		{
			return new Dictionary<TKey, TValue>(dict);
		}

        public IList<T> GetNewList<T>()
		{
			return new List<T>();
		}

        public IList<T> GetNewList<T>(int capacity)
		{
			return new List<T> (capacity);
		}

        public IList<T> GetNewList<T>(IEnumerable<T> collection)
		{
			return new List<T>(collection);
		}

        public ISet<T> GetNewSet<T>()
		{
			return new SortedSet<T>();
		}

        public ISet<T> GetNewSet<T>(IEnumerable<T> collection)
		{
			return new SortedSet<T>(collection);
		}

		#endregion
	}
}

